package com.noexcs.forum.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

import java.util.Date;

/**
 * @author noexcs
 * @since 5/23/2022 9:59 PM
 */
@Data
@Builder
@AllArgsConstructor
public class Message {
    int id;
    /**
     * 用户id
     * 为0时为系统消息
     */
    int fromId;
    int toId;
    /**
     * t1 = Math.min(fromId, toId)
     * t2 = Math.max(fromId, toId)
     * conversationId = t1 + "_" + t2
     */
    String conversationId;
    String content;
    /**
     * 0 未读
     * 1 已读
     * 2 删除
     */
    int status;
    Date createTime;

    public Message() {

    }
}
